home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_pitlines.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  147 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_pitlines.cog
  4. #
  5. # A few saylines
  6. #
  7. # [RKD & revised by HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ==============================================================================
  11.  
  12. symbols
  13.  
  14. message    entered
  15.  
  16. sector    pit
  17. sector    badpit
  18.  
  19. thing    pitcam        nolink
  20. thing    player        nolink    local
  21. thing    indyactor    nolink
  22. thing    indylook    nolink
  23.  
  24. thing    cam1spot    local
  25. thing    cam1look    local
  26.  
  27. sound    natural=pr03j01.wav        local
  28. sound    hornerdug=pr03j02.wav    local
  29.  
  30. template    tpl_ghost=ghost        local
  31.  
  32. vector    v_camspot        local
  33.  
  34. int        pitsaid=0    local
  35.  
  36. # subroutines
  37. flex    startscene=0    local
  38. flex    endscene=0        local
  39. flex    fixcams=0        local
  40. end
  41.  
  42. code
  43.  
  44. entered:
  45. # ---> pit, badpit
  46.         
  47.     player = GetLocalPlayerThing();
  48.     
  49.     # if player enters lower pit first, or enters pit with jeep, prohibit sayline
  50.     if ((GetSenderRef() == badpit) || (global2 == 1))
  51.     {
  52.         pitsaid = 1;
  53.         return;
  54.     }
  55.     
  56.     # if sayline locked out for any reason, exit
  57.     if (pitsaid) return;
  58.     pitsaid = 1;
  59.     
  60.     # give player a chance to get further into the area
  61.     Sleep(2);
  62.  
  63.     # make sure he's still in a good spot
  64.     if (GetThingSector(player) != pit) return;
  65.     
  66.     if (GetSenderRef() == pit)
  67.     {
  68.         # prepare the player
  69.         if (MakeMeStop() == -1) return;
  70.         DeselectWeaponWait(player);
  71.         
  72.         sleep(1);
  73.         
  74.         # start cutscene, swing camera out
  75.         call startscene;
  76.  
  77.         cam1spot = CreateThing(tpl_ghost, player);
  78.         CaptureThing(cam1spot);
  79.         cam1look = CreateThing(tpl_ghost, player);
  80.         CaptureThing(cam1look);
  81.         MakeCamera2LikeCamera1(cam1spot, cam1look);
  82.         SetCameraLookInterp(2, 0);
  83.         SetCameraPosInterp(2, 0);
  84.         SetCameraFocus(2, cam1spot);
  85.         SetCameraSecondaryFocus(2, cam1look);
  86.         SetCurrentCamera(2);
  87.         SetCameraFOV(90, 0, 0.0);
  88.         SetCameraLookInterp(2, 1);
  89.         SetCameraPosInterp(2, 1);
  90.         SetCameraInterpSpeed(2, 1.5);
  91.         Sleep(0.01);
  92.         SetCameraFocus(2, pitcam);
  93.         SetCameraSecondaryFocus(2, indylook);
  94.  
  95.         SetThingMaxRotVel(indyactor, 180);
  96.         AISetLookThing(indyactor, indylook);
  97.         AIWaitForStop(indyactor);
  98.     
  99.         Sleep(1.0);
  100.         PlayVoice(indyactor, natural, 1, 1);
  101.         Sleep(0.5);
  102.         PlayVoice(indyactor, hornerdug, 1, 1);
  103.  
  104.         Sleep(0.5);
  105.         call endscene;
  106.     }
  107.  
  108.     return;
  109.  
  110. startscene:
  111.     call fixcams;
  112.  
  113.     StartCutscene(1);
  114.     CopyOrientAndPos(player, indyactor);
  115.     CopyPlayerHolsters(player, indyactor);
  116.     ClearThingFlags(indyactor, 0x80000);
  117.     SetActorFlags(player, 0x200000);
  118.     SetThingFlags(player, 0x80000);
  119.     
  120.     return;
  121.  
  122. endscene:
  123.     call fixcams;
  124.  
  125.     CopyOrientAndPos(indyactor, player);
  126.     SetThingFlags(indyactor, 0x80000);
  127.     ClearThingFlags(player, 0x80000);
  128.  
  129.     v_camspot = VectorAdd(VectorTransformToOrient(player, '0.3 -0.05 0.05'), GetThingPos(player));    
  130.     SetCameraPosition(1, v_camspot);
  131.     SetCurrentCamera(1);
  132.  
  133.     EndCutscene();
  134.     ClearActorFlags(player, 0x200000);
  135.  
  136.     return;
  137.  
  138. fixcams:
  139.     #reset camera settings
  140.     ResetCameraFOV(0, 0.0);
  141.     SetCameraPosInterp(2, 0);
  142.     SetCameraLookInterp(2, 0);
  143.  
  144.     return;
  145.     
  146. end
  147.